/*
 * Powered By XY
 * Since 2020
 */

package com.xy.biz.fd.dao;

import java.util.Collection;
import java.util.List;

import com.xy.biz.fd.domain.bo.DocumentShareBO;
import com.xy.biz.fd.domain.po.DocumentSharePO;
import com.xy.biz.fd.domain.query.DocumentShareQuery;

/**
 *
 *
 * @author wcs
 * @date 2021-2-8
 */
public interface DocumentShareDao {

	/**
	 * 保存
	 *
	 * @param documentSharePO
	 */
	int saveDocumentShare(DocumentSharePO documentSharePO);

	/**
	 * 保存多个
	 *
	 * @param collection
	 */
	int saveAllDocumentShare(Collection<DocumentSharePO> collection);

	/**
	 * 更新
	 *
	 * @param documentSharePO
	 */
	int updateDocumentShare(DocumentSharePO documentSharePO);

	/**
	 * 删除(分享状态改为取消)
	 *
	 * @param documentShareId
	 */
	int deleteDocumentShare(Long documentShareId);

	/**
	 * 删除（将delete_flag设为1）
	 *
	 * @param documentShareId
	 */
	int relDeleteDocumentShare(Long documentShareId);

	/**
	 * 批量删除
	 *
	 * @param collection
	 */
	int updateDocumentShareS(Collection<Long> collection);

	/**
	 * 批量删除
	 *
	 * @param collection
	 */
	int updateDocumentExitsShareS(Collection<Long> collection);

	/**
	 * 查找一个
	 *
	 * @param documentShareId
	 * @return
	 */
	DocumentSharePO getDocumentShare(Long documentShareId);

	/**
	 * 根据创建用户id,文档id,分享目标用户id查找
	 *
	 * @param documentShareBO
	 * @return
	 */
	DocumentSharePO getDocumentShareOne(DocumentShareBO documentShareBO);

	/**
	 * 查找多条
	 *
	 * @param collection
	 * @return
	 */
	List<DocumentSharePO> listDocumentShareById(Collection<Long> collection);

	/**
	 * 条件查找多条
	 *
	 * @param query 查找条件
	 * @return
	 */
	List<DocumentSharePO> listDocumentShare(DocumentShareQuery query);

	/**
	 * 条件统计个数
	 *
	 * @param query 查找条件
	 * @return
	 */
	int countDocumentShare(DocumentShareQuery query);

	/**
	 * 批量插入查询是否存在分享的
	 * @param query
	 * @return
	 */
	int cancelExistingShare(DocumentShareQuery query);
}
